home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 326-350 / disk_348 / samp / instypetest.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  60 lines

  1. /* instype.library C application
  2.  
  3.     Set your editor's TAB width to 3
  4.  
  5.     cc +p InsTypeTest.c
  6.     as -cd CInterface.asm
  7.     ln InsTypeTest.o CInterface.o -lcl32
  8.  
  9.     This program can only be run from the CLI. It gets the user's selection of
  10. SAMP InstrumentType via the instype.library, and then converts the byte back
  11. into a string to print to the CLI
  12. */
  13.  
  14. #include "functions.h"      /* Manx C declarations */
  15.  
  16. #include "exec/tasks.h"
  17. #include "exec/types.h"
  18.  
  19.  
  20. /*-------------------------------defines---------------------------------*/
  21.  
  22. struct InsTypeBase    *InsTypeBase=0L;
  23.  
  24.  
  25. /*----------------------------start of main()----------------------------*/
  26.  
  27. main( argc, argv )
  28. LONG argc;
  29. UBYTE *argv[];
  30. {
  31.     LONG    err;
  32.  
  33.  /* Open the instype lib */
  34.     if( !(InsTypeBase=(struct InsTypeBase *)OpenLibrary("instype.library", 0L)) )
  35.     {
  36.         printf("Need the dissidents instype.library on boot disk\n");
  37.         exit();
  38.     }
  39.  
  40.     err = (LONG)GetInsType(0L);  /* Open it on WB screen because of zero. Normally,
  41.                                     you would pass the ptr to your application's screen */
  42.  
  43.  /* Check for errors (negative numbers). Otherwise, a legit InstrumentType */
  44.     if( err < 0 )
  45.     {
  46.         puts("Error in obtaining InstrumentType");
  47.     }
  48.     else
  49.     {
  50.         /* Get a string that describes that InstrumentType */
  51.         puts( (UBYTE *)GetInsString(err) );
  52.     }
  53.  
  54.     printf("\n");
  55.  
  56.     CloseLibrary( InsTypeBase );
  57.     exit( FALSE );
  58.  
  59. }
  60.